﻿<?php
require '../bin/Common/Guid.class.php';
require '../bin/DBA/DB.class.php';
require '../bin/DAL/ContactDAL.php';
require '../bin/BLL/ContactBLL.php';
require '../bin/DAL/Parameter.class.php';
$gid = null;
if ($_POST["ipt_guid"] == "")
{
    $guid = new Guid();
    $gid = $guid->toString();
}
else
{
    $gid = $_POST["ipt_guid"];
}
 //
$Chs_Address = $_POST["ipt_chs_address"];
$Chs_Name = $_POST["ipt_chs_name"];
$Chs_Phone = $_POST["ipt_chs_phone"];
$Chs_Fax = $_POST["ipt_chs_fax"];
$Chs_mail = $_POST["ipt_chs_mail"];
 //Ӣ
$Eng_Address = $_POST["ipt_eng_address"];
$Eng_Name = $_POST["ipt_eng_name"];
$Eng_Phone = $_POST["ipt_eng_phone"];
$Eng_Fax = $_POST["ipt_eng_fax"];
$Eng_mail = $_POST["ipt_eng_mail"];
 //
$Deu_Address = $_POST["ipt_deu_address"];
$Deu_Name = $_POST["ipt_deu_name"];
$Deu_Phone = $_POST["ipt_deu_phone"];
$Deu_Fax = $_POST["ipt_deu_fax"];

$chs_array = array(
'address' => $Chs_Address,
'name' => $Chs_Name,
'telephone' => $Chs_Phone,
'fax' => $Chs_Fax,
'email' => $Chs_mail,
'guid' => $gid
);
$eng_array = array(
'address' => $Eng_Address,
'name' => $Eng_Name,
'telephone' => $Eng_Phone,
'fax' => $Eng_Fax,
'email' => $Eng_mail,
'guid' => $gid
);
$deu_array = array(
'address' => $Deu_Address,
'name' => $Deu_Name,
'telephone' => $Deu_Phone,
'fax' => $Deu_Fax,
'email' => $Deu_mail,
'guid' => $gid
);
if (ContactBLL::GenByChs_Contact())
{
        echo "有数据";
	ContactBLL::EditByChs_Contact($chs_array);
}
else
{
         echo "无数据";
	ContactBLL::SaveByChs_Contact($chs_array);
}
if (ContactBLL::GenByEng_Contact())
{
	ContactBLL::EditByEng_Contact($eng_array);
}
else
{
	ContactBLL::SaveByEng_Contact($eng_array);
}
if (ContactBLL::GenByDeu_Contact())
{
	ContactBLL::EditByDeu_Contact($deu_array);
}
else
{
	ContactBLL::SaveByDeu_Contact($deu_array);
}
?>